<?php $imagePath = $this->baseUrl('/application/modules/blocks/frontend-views/scripts/');?>

<div id="wrapper_menu"><!-- BEGIN MENU WRAPPER -->
<?php require_once 'application/modules/blocks/frontend-views/scripts/menu.phtml';  ?> 
</div>
<!-- END MENU WRAPPER --> 

<!-- START OF NEWS TRICKER -->
<div id="news_tricker_container">
  <div class="news_tricker_inner">
    <div id="ticker-wrapper" class="no-js">
      <ul id="js-news" class="js-hidden">
        <?php foreach ($this->newsList as $item):?>
        <li class="news-item"><a href="<?php echo $item->link ?>"><?php echo $item->content;?></a></li>
        <?php endforeach;?>
      </ul>
    </div>
    <div id="ticker-controls_post">
      <p id="play-pause_post"class="button"><a>Pause</a></p>
      <!-- 
              <p id="prev_post" class="button"><a><span id="prev_post_bg">&nbsp;</span></a></p>
              <p id="next_post" class="button"><a><span id="next_post_bg">&nbsp;</span></a></p>
              -->
      <div id="prev_post" class="prev_post_bg"><a href="##">&nbsp;&nbsp;&nbsp;</a></div>
      <div id="next_post" class="next_post_bg"><a href="##">&nbsp;&nbsp;&nbsp;</a></div>
    </div>
  </div>
</div>

<!-- hidden search form -->
<div style="display:none;">
<form action="<?php echo $this->baseUrl();?>/bbling/index/search" method="post"  id="search_form_investor">        
  <input  name="search[industry]" id="searchindustry_investor" />
  <input name="search[location]" id="searchlocation_investor" value="*"/>
  <input name="search[fund]" id="searchfund_investor" value="*" />
  <input name="search[state]" id="searchstate_investor" value="*" />
  <input type="submit" class="search_form_investor" />
</form>
</div>
<!-- THE SPAN BELOW IS JUST USED FOR STORE THE BASE URL -->
<span class="baseUrl_hidden" style="display:none;"><?php echo $this->baseUrl();?></span>
<!-- END OF NEWS TRICKER --> 
<script type="text/javascript" charset="utf-8">
 
$(document).ready(function(){

  $('#js-news').ticker({
	  displayType: "fade",
	  controls:true,
	  titleText: "Latest News:"
	  });
  news_ticker_button_syn();  

  //WHEN CLICK THE A LABEL THEN REDIRECT TO THE SEARCH ACTION
  $(".searchcolumn ul li ").click(function(){
      var industry = $(this).children("a").html();
      //var base_url = $(".baseUrl_hidden").html();
      //var url = base_url + '/bbling/index/search?state=*&fund=*&location=*&industry='+industry;
      //window.location.href=url;
      $("#searchindustry_investor").val( industry );
      $(".search_form_investor").click(); 
      
      
	  });
  
});


var news_tricker_timeId = 0;

function news_tricker_resume(){
	$("#ticker-controls_post #play-pause_post").click();
}

function news_ticker_button_syn(){
	$("#ticker-controls_post #play-pause_post").click(function(){
		  $("#ticker-controls #play-pause").click();
	  });

	  $("#ticker-controls_post #prev_post").click(function(){
		  $("#ticker-controls #prev").click();
		  window.clearTimeout(news_tricker_timeId);
		  news_tricker_timeId = window.setTimeout( "news_tricker_resume()" , 2000 );
	  });

	  $("#ticker-controls_post #next_post").click(function(){
		  $("#ticker-controls #next").click();
		  window.clearTimeout(news_tricker_timeId);
		  news_tricker_timeId = window.setTimeout( "news_tricker_resume()" , 2000 );
	  });
}

</script>